/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
<template>
  <m-list-construction title="创建任务">
    <template slot="content">
      <div v-show="!createStatus">
        <div class="mt20">
          <mList></mList>
        </div>
        <div>
          <mCreate @success="onSuccess"></mCreate>
        </div>
      </div>
      <template v-if="createStatus">
        <mCreateSuccess
          :taskInfo="taskInfo"
          @cancel="createStatus = false"
        ></mCreateSuccess>
      </template>

    </template>
  </m-list-construction>
</template>
<script>
  // import _ from 'lodash'
  import mList from './_source/list'
  import mCreate from './_source/create'
  import mCreateSuccess from './_source/createSuccess'
  // import store from '@/conf/home/store'
  import mListConstruction from '@/module/components/listConstruction/listConstruction'

  export default {
    name: 'scheduler-task-create',
    data () {
      return {
        total: null,
        isLoading: true,
        routeList: [],
        createStatus: false,
        searchParams: {
          pageSize: 10,
          pageNum: 1,
          searchVal: ''
        },
        isLeft: true,
        item: {},
        createDialog: false,
        taskInfo: null
      }
    },
    props: {},
    methods: {
      _getList (flag) {

      },
      onSuccess (data) {
        this.taskInfo = data
        this.createStatus = true
      }
    },
    watch: {

    },
    beforeDestroy () {
      sessionStorage.setItem('isLeft', 1)
    },
    components: { mListConstruction, mList, mCreate, mCreateSuccess }
  }
</script>
